#ifndef GAMEGLOBALS_H
#define GAMEGLOBALS_H

#include <SFML/Network.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

#include <iostream>
#include <vector>

#define _CRT_SECURE_NO_WARNINGS

#define PORT 1337

#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600

#define PADDLE_WIDTH 21
#define PADDLE_HEIGHT 70

#define BALL_WIDTH 16
#define BALL_HEIGHT 16

#define BALL_SPEED 0.03
#define PADDLE_SPEED .02
#define PADDLE_0_X 0
#define PADDLE_1_X SCREEN_WIDTH - PADDLE_WIDTH

typedef struct GameState
{
	float paddle_y[2];
	float ball_x;
	float ball_y;
}GS;

//handle receiving of game state
inline sf::Packet& operator <<(sf::Packet& Packet, const GS& gs)
{
	return Packet << gs.ball_x << gs.ball_y << gs.paddle_y[0] << gs.paddle_y[1];
}

//handle sending of game state
inline sf::Packet& operator >>(sf::Packet& Packet, GS& gs)
{
	return Packet >> gs.ball_x >> gs.ball_y >> gs.paddle_y[0] >> gs.paddle_y[1];
}


#endif //GAMEGLOBALS_H